package com.作业.第八章作业.HomeWork10;

public class Doctor {
    private String name;
    private int age;
    private String job;
    private String gender;
    private double salary;

    public Doctor(String name, int age, String job, String gender, double salary) {
        this.name = name;
        this.age = age;
        this.job = job;
        this.gender = gender;
        this.salary = salary;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Doctor){
            if(this.hashCode() == obj.hashCode()){
                return true;
            }
            Doctor Obj = (Doctor)obj;
            if(this.name.equals(Obj.name) && this.age == Obj.age && this.gender.equals(Obj.gender)
                    && this.job.equals(Obj.job) && this.salary == Obj.salary)
            return true;

            return false;
        }
        else
            return false;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
